package com.eningqu.aipen.ui.view;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;

import androidx.annotation.NonNull;

import com.eningqu.aipen.MyApplication;
import com.eningqu.aipen.demo.R;

public abstract class BaseDialog extends Dialog {

    public BaseDialog(@NonNull Context context) {
        super(context == null ? MyApplication.mContext : context, R.style.CustomDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //按空白处不能取消动画
        setCanceledOnTouchOutside(false);
        setCancelable(false);
        setContentView(layoutId());
        init();
    }

    protected abstract void init();

    protected abstract int layoutId();


}